<%@ include file="/taglibs.jsp"%>
<table>

    <display:table name="exchanges" class="table" id="exchangeList" requestURI="">
	    <display:column titleKey="sender.fullName" escapeXml="true">${exchangeList.sender.fullname}</display:column>
	    <display:column titleKey="sender.date" escapeXml="true">
	    	<joda:format value="${exchangeList.date}" pattern="dd/MM/yyyy HH:mm"/>
	    </display:column>
	    <display:column titleKey="user.department" property="user.department.name"/>
	    <display:column property="comment" titleKey="sender.comment"/>
	</display:table>
   

	<s:form name="exchangeForm" id="exchangeForm" action="saveExchange" method="post">
	<s:hidden name="id" value="%{file.id}"/>
<s:if test="ableToNextStep">		
		<table>
		 <tr> 
			<td>
		        <s:property value="getText('file.group')"/>:
		    </td>    
			<td>
				<s:select name="groupIdToExchange" list="depts" listKey="id" listValue="name" theme="simple" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"/>
			</td>
		</tr>
		<tr> 
			<td>
		        <s:select
		         headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"
		         label="%{getText('file.user')}"
		         list="listUserForExchange" 
		         listValue="name"
		         name="userExchanges" 
				 listKey="value"
		          />
			</td> 	
		</tr>
		<tr>
	       <td>
		        <s:property value="getText('file.exchange.info')"/>:
		    </td> 
		    <td>
		    	<s:textarea maxlength="600" key="comment" cols="50" rows="7" theme="simple" />
		    </td>
		</tr>
		<tr>
		    <td>
		    	<%-- <s:submit cssClass="button" name="save" value="%{getText('button.save.title')}" theme="simple" onclick="form.onsubmit=null"></s:submit> --%>
		    	<s:a href="javascript:void(0)" id="exchange" >
		    		<img src="${ctx}/images/btn_send_message_link.png">
				</s:a>					    	
		    </td>
		</tr>
		</table>	
	</s:if>
	</s:form>
   </table>